// NeuralNetwork.h: interface for the NeuralNetwork class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_NEURALNETWORK_H__4B24B25B_44AF_4756_A5A4_393E56409794__INCLUDED_)
#define AFX_NEURALNETWORK_H__4B24B25B_44AF_4756_A5A4_393E56409794__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "Common/NeuralNet/TDlambda.h"

enum {RUN=0, TURNLEFT, TURNRIGHT}; //All possible actions
enum {ACTION_RANDOM, ACTION_ROULETTE, ACTION_WINNER};
/**
 * \class NeuralNetwork
 * \author Peter Lacko
 * \brief interface for TDlambda learning
 */
class NeuralNetwork  
{
public:
	NeuralNetwork(int inCountInputLayer, int inCountHiddenLayer, double inAlpha, double inLambda, int inEnviromentSize, int inActionSize);
	~NeuralNetwork();

	int GetAction(double *enviroment, int *possibleActions, int actionsCount, int selection);
	int StartLearning();
	int EndLearning(double reward);

	TDlambda* network;

private:
	void NeuralNetwork::CreateBinaryCode(int number, double *array, int maxBitCount);
	int enviromentSize;
	int actionSize;
	double *y;

	int pPointer;
	double **P; //TODO very bad!!!!
};

#endif // !defined(AFX_NEURALNETWORK_H__4B24B25B_44AF_4756_A5A4_393E56409794__INCLUDED_)
